package com.ruoyi.refund.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.refund.mapper.RefundDetailMapper;
import com.ruoyi.refund.domain.RefundDetail;
import com.ruoyi.refund.service.IRefundDetailService;

/**
 * 退款明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-04
 */
@Service
public class RefundDetailServiceImpl implements IRefundDetailService 
{
    @Autowired
    private RefundDetailMapper refundDetailMapper;

    /**
     * 查询退款明细
     * 
     * @param id 退款明细主键
     * @return 退款明细
     */
    @Override
    public RefundDetail selectRefundDetailById(Long id)
    {
        return refundDetailMapper.selectRefundDetailById(id);
    }

    /**
     * 查询退款明细列表
     * 
     * @param refundDetail 退款明细
     * @return 退款明细
     */
    @Override
    public List<RefundDetail> selectRefundDetailList(RefundDetail refundDetail)
    {
        return refundDetailMapper.selectRefundDetailList(refundDetail);
    }

    /**
     * 新增退款明细
     * 
     * @param refundDetail 退款明细
     * @return 结果
     */
    @Override
    public int insertRefundDetail(RefundDetail refundDetail)
    {
        refundDetail.setCreateTime(DateUtils.getNowDate());
        return refundDetailMapper.insertRefundDetail(refundDetail);
    }

    /**
     * 修改退款明细
     * 
     * @param refundDetail 退款明细
     * @return 结果
     */
    @Override
    public int updateRefundDetail(RefundDetail refundDetail)
    {
        refundDetail.setUpdateTime(DateUtils.getNowDate());
        return refundDetailMapper.updateRefundDetail(refundDetail);
    }

    /**
     * 批量删除退款明细
     * 
     * @param ids 需要删除的退款明细主键
     * @return 结果
     */
    @Override
    public int deleteRefundDetailByIds(Long[] ids)
    {
        return refundDetailMapper.deleteRefundDetailByIds(ids);
    }

    /**
     * 删除退款明细信息
     * 
     * @param id 退款明细主键
     * @return 结果
     */
    @Override
    public int deleteRefundDetailById(Long id)
    {
        return refundDetailMapper.deleteRefundDetailById(id);
    }
}
